home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_sol_explodingdebris.cog < prev    next >
Text File  |  1999-11-15  |  10KB  |  366 lines

  1. # Jones 3d Cog Script
  2. #
  3. # SOL_ExplodingDebris.cog
  4. #
  5. # [TRM]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.     
  12.     message     startup
  13.     message     activated
  14.     message     entered
  15.     message     damaged
  16.     message     pulse
  17.     
  18.     thing       player          local
  19.     thing       indy            local
  20.     thing       dustThing       local    
  21.     thing       coffinCam
  22.     thing       coffin
  23.     thing       ghost
  24.     thing       target
  25.     thing       target1
  26.     thing       ghostSnake1
  27.     thing       ghostSnake2
  28.     thing       ghostSnake3
  29.     thing       ghostSnake4
  30.     thing       ghostSnake5
  31.     thing       indyCam
  32.     thing       interpCam
  33.     thing       dustPos         # dust cloud origin
  34.     thing       debrisPos1
  35.     thing       debrisPos2
  36.     
  37.     template    tplCoffin=opnsarc           local
  38.     template    tplSnake1=snake_a           local
  39.     template    tplSnake2=snake_b           local
  40.     template    tplActor=indy_sh_actor      local
  41.     template    dust=dustcloud              local
  42.     template    tpl_Debris=+dummy_debris    local
  43.            
  44.     surface     front       mask=0x408
  45.     surface     back
  46.     surface     inside
  47.     
  48.     surface     shelf1
  49.     surface     shelf2
  50.     surface     shelf3
  51.     surface     shelf4
  52.     
  53.     surface     step1
  54.     surface     step2
  55.     surface     step3
  56.     surface     step4
  57.     surface     step5
  58.     
  59.     surface     surf_BlockIt0
  60.     surface     surf_BlockIt1
  61.     
  62.     surface     sayIt
  63.     
  64.     # ** sound fx **
  65.     sound        sfx_Explode=shw_wall_crash.wav          local   # like, bang.
  66.     #sound       charging=nub_aethlight_on_c.wav         local
  67.     
  68.     # snake voice lines
  69.     sound       inSay1=Inxj069.wav                      local   # snakes
  70.     sound       inSay2=Inxj073.wav                      local   # why did it...
  71.     
  72.     # shakey wall voice lines
  73.     sound       inVibrate=Inxj026.wav                   local   # A little vibration...
  74.     sound       inCrumble=Inxj025.wav                   local   # ...ready to crumble.
  75.     
  76.     material    dustMat=gen_a4sfx_dustcloud.mat                local
  77.     
  78.     cog         hintCog
  79.     cog         cameraShake
  80.     
  81.     vector      liteval             local
  82.     vector      nolite              local
  83.     vector      playerVec           local
  84.     vector      dustStart           local
  85.     vector      dustEnd         local
  86.     
  87.     int         done=0              local
  88.     int         curCam              local
  89.     int         coffin2             local
  90.     int         playing=0           local
  91.     int         saidIt=0            local
  92.     
  93.     flex        count=0             local
  94.     flex        playerY=0           local
  95.     flex        playerX=0           local
  96.     
  97.     # ** subroutines **
  98.     flex        vibeLine            local        
  99.     
  100. end
  101. # ========================================================================================
  102.  
  103. code
  104.  
  105. startup:
  106.  
  107.     liteval = VectorSet(0.25, 0.55, 1.0);
  108.     nolite = VectorSet(0, 0, 0);
  109.     
  110.     SetFaceGeoMode(step1, 0);
  111.     SetFaceGeoMode(step2, 0);
  112.     SetFaceGeoMode(step3, 0);
  113.     SetFaceGeoMode(step4, 0);
  114.     SetFaceGeoMode(step5, 0);
  115.     
  116.     return;
  117.     
  118. # ========================================================================================
  119.  
  120. activated:
  121.  
  122.     player = GetLocalPlayerThing();
  123.  
  124.     if((GetSenderRef() == front) && (done == 0) && (playing == 0))
  125.     {
  126.         # player activated with an IMP part so bail out
  127.         if((GetCurWeapon(player) >= 14) && (GetCurWeapon(player) <= 18)) return;
  128.         
  129.         # player activated with lighter
  130.         else if(GetCurWeapon(player) == 13)
  131.         {
  132.             playing = 1;
  133.             
  134.             # put away the lighter
  135.             DeselectWeapon(player);
  136.             DeselectWeaponWait(player);
  137.             
  138.             Call vibeLine;
  139.             playing = 0;
  140.         }
  141.         
  142.         # normal activation
  143.         else
  144.         {
  145.             playing = 1;
  146.             
  147.             # wait for weapon to be put away
  148.             DeselectWeaponWait(player);
  149.             
  150.             Call vibeLine;
  151.             playing = 0;
  152.         }
  153.     }   
  154.  
  155.     return;
  156.     
  157. # ========================================================================================
  158.  
  159. entered:
  160.  
  161.     player = GetLocalPlayerThing();
  162.     playerVec = GetThingLVec(player);
  163.     playerY = VectorY(playerVec);
  164.     playerX = VectorX(playerVec);
  165.  
  166.     if((GetSenderRef() == sayIt) && (saidIt == 0))
  167.     {
  168.         if((playerY < 0) && ((playerX > -0.7) && (playerX < 0.7)))  # south
  169.         {
  170.             saidIt = 1;
  171.             playing = 1;
  172.             PlayVoice(player, inCrumble, 1.0, 1);
  173.             playing = 0;
  174.         }
  175.     }
  176.     
  177.     return;   
  178.         
  179. # ========================================================================================
  180.  
  181. damaged:
  182.  
  183.     player = GetLocalPlayerThing();
  184.     
  185.     if((GetParam(1) == 0x1000) && (done == 0))
  186.     {
  187.         done = 1;
  188.         
  189.         # do cutscene stuff
  190.         MakeMeStop();
  191.         StartCutscene(1);
  192.         
  193.         # Switch to indyCam
  194.         SetCameraFocus(2, indyCam);
  195.         SetCameraSecondaryFocus(2, player);
  196.         SetCurrentCamera(2);
  197.         
  198.         # start cameraShake
  199.         SendMessage(cameraShake, user2);
  200.         
  201.         # fire up IMP#1
  202.         SetCameraFOV(70, 1, 1.5);
  203.         #PlaySoundLocal(charging, 1.0, 0.0, 0x0, 0);
  204.         SetThingLight(player, liteval, 5.0, 2.0);
  205.         Sleep(1.5);
  206.         
  207.         # Switch to coffinCam and zoom out...
  208.         SetCameraFocus(2, coffinCam);
  209.         SetCameraSecondaryFocus(2, target);
  210.         SetCurrentCamera(2);
  211.         SetCameraFOV(110, 1, 3.0);
  212.         Sleep(2.0);
  213.         
  214.         # BANG!                                                                                        
  215.         PlaySoundThing(sfx_Explode, target, 1.0, 10.0, 20.0, 0);
  216.         SetFaceGeoMode(front, 0);       # no draw
  217.         SetFaceGeoMode(inside, 0);
  218.         SetAdjoinFlags(front,2);        # move
  219.         SetAdjoinFlags(back,2);
  220.         SetThingLight(player, nolite, 0.001, 2.0);
  221.         
  222.         # create dust cloud
  223.         dustStart = VectorSet(0.2, 0.2, 0.5);
  224.         dustEnd    = VectorSet(1.2, 1.2, 0.0);
  225.         dustThing = CreateThing(dust, dustPos);
  226.         CaptureThing(dustThing);
  227.         
  228.         # animate dust cloud
  229.         SetMaterialCel(dustMat, 0);
  230.         MaterialAnim(dustMat, 8.0, 1);
  231.         AnimateSpriteSize(dustThing, dustStart, dustEnd, 7.0);
  232.         
  233.         # create debris
  234.         CreateThing(tpl_Debris, debrisPos1);
  235.         CreateThing(tpl_Debris, debrisPos2);
  236.     
  237.         # Fling the coffin and watch it go by
  238.         MoveToFrame(coffin, 1, 8.0);
  239.         Sleep(0.2);
  240.         SetFaceGeoMode(shelf1, 0);
  241.         SetFaceGeoMode(shelf2, 0);
  242.         SetFaceGeoMode(shelf3, 0);
  243.         SetFaceGeoMode(shelf4, 0);
  244.         SetFaceGeoMode(step1, 4);
  245.         SetFaceGeoMode(step2, 4);
  246.         SetFaceGeoMode(step3, 4);
  247.         SetFaceGeoMode(step4, 4);
  248.         SetFaceGeoMode(step5, 4);
  249.         MoveToFrame(target, 1, 6.2);
  250.         MoveToFrame(coffinCam, 1, 4.5);
  251.         
  252.         # kill coffin and fire up coffin2
  253.         DestroyThing(coffin);
  254.         coffin2 = CreateThing(tplCoffin, ghost);
  255.         CaptureThing(coffin2);
  256.         Sleep(0.1);
  257.         MoveToFrame(coffin2, 1, 5.0);
  258.        
  259.         # stop cameraShake
  260.         SendMessage(cameraShake, user3);
  261.         
  262.         # reset coffin collision
  263.         SetCollideType(coffin2, 3);
  264.         
  265.         # Create first wave of snakes
  266.         CreateThing(tplSnake1, ghostSnake3);
  267.         CreateThing(tplSnake2, ghostSnake4);
  268.         CreateThing(tplSnake1, ghostSnake5);
  269.         
  270.         # Create second wave of snakes
  271.         Sleep(2.0);
  272.         CreateThing(tplSnake1, ghostSnake1);
  273.         CreateThing(tplSnake2, ghostSnake2);
  274.         
  275.         # create more snakes
  276.         #SetPulse(2.0);
  277.         
  278.         # put away IMP#1
  279.         DeselectWeapon(player);
  280.         DeselectWeaponWait(player);
  281.         
  282.         # hide player, create actor
  283.         SetThingFlags(player, 0x80000);
  284.         indy = CreateThing(tplActor, player);
  285.         CaptureThing(indy);
  286.         CopyPlayerHolsters(player, indy);
  287.         ClearThingFlags(indy, 0x80000);
  288.         
  289.         # Indy takes a few steps, complains about snakes
  290.         PlaySoundLocal(inSay1, 1.0, 0.0, 0x0, 1);
  291.         MoveToFrame(target, 2, 0.7);
  292.         AISetMoveSpeed(indy, 1.0);
  293.         AISetLookThing(indy, coffin2);
  294.         AISetMoveThing(indy, target1, 1.2);
  295.         PlaySoundLocal(inSay2, 1.0, 0.0, 0x0, 0);
  296.         Sleep(3.0);
  297.         
  298.         # block access to coffin2
  299.         SetAdjoinFlags(surf_BlockIt0, 0x10);    # no player move
  300.         SetAdjoinFlags(surf_BlockIt1, 0x10);
  301.         
  302.         # Get the player into position
  303.         CopyOrientAndPos(indy, player);
  304.         
  305.         # hide indy show player
  306.         SetThingFlags(indy, 0x80000);
  307.         ClearThingFlags(player, 0x80000);
  308.         
  309.         # return camera and controls to player
  310.         ClearActorFlags(player, 0x200000);
  311.         SetCurrentCamera(1);
  312.         
  313.         EndCutscene();
  314.         
  315.         # tell hintCog to solve hint24
  316.         SendMessage(hintCog, user0);
  317.     }
  318.     
  319.     return;
  320.     
  321. # ========================================================================================
  322.  
  323. vibeLine:
  324.  
  325.     # do cutscene stuff
  326.     MakeMeStop();
  327.     StartCutscene(0);
  328.     
  329.     # interp camera
  330.     SetExtCamOffsetToThing(interpCam);
  331.     #Sleep(0.5);
  332.     
  333.     # activate face and say line
  334.     #PlayMode(player, 60, 0);
  335.     #Sleep(0.3);
  336.     PlayVoice(player, inVibrate, 1.0, 1);
  337.     
  338.     # restore controls and camera
  339.     ClearActorFlags(player, 0x200000);
  340.     RestoreExtCam();
  341.     
  342.     EndCutscene();
  343.     
  344.     return;
  345.     
  346. # ========================================================================================
  347.  
  348. pulse:
  349.  
  350.     if(count == 2)
  351.     {
  352.         SetPulse(0.0);
  353.     }
  354.         
  355.     count = count + 1;
  356.     
  357.     CreateThing(tplSnake1, ghostSnake1);
  358.     CreateThing(tplSnake2, ghostSnake2);
  359.     
  360.     return;
  361.  
  362. # ========================================================================================
  363.  
  364. end
  365.  
  366.